<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@include file="/resource/common/taglib.jspf"%>
<%@include file="/resource/common/jquery.jspf"%>
<%@include file="/resource/common/commonCss.jspf"%>
<%@include file="/resource/common/bootstrap.jspf"%>
<%@include file="/resource/common/validate.jspf"%>
<%@include file="/resource/common/kindeditor.jspf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>添加</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<link rel="stylesheet" href="${ctxStatic}/plugins/upload/image.css" type="text/css" media="screen" />
	<script type="text/javascript" src="${ctxStatic }/js/system/asyncDoSubmitForm.js"></script>
	<script type="text/javascript" src="${ctxStatic }/plugins/upload/uploadImageUtils.js"></script>
	<%@include file="/resource/common/wdate-picker.jspf"%>
	<style type="text/css">
		.tab-content{
			border-left: 1px solid #ddd;
			border-bottom: 1px solid #ddd;
			border-right: 1px solid #ddd; 
			padding: 15px;
		}
	</style>
</head>
<body>
<div class="panel panel-default">
    <div class="panel-body">
		<input type="hidden" id="asyncResult" name="asyncResult" value="-1" /> 
		<input type="hidden" id="asyncResultData" name="asyncResultData" value="-1" /> 
		<input type="hidden" id="asyncResultError" name="asyncResultError" value="-1" />
		<form:form id="inputForm" name="form1" class="form-horizontal" method="post" action="addWebJob.do" modelAttribute="WebJob">
			<ul id="myTab" class="nav nav-tabs">
				<li class="active"><a href="#info" data-toggle="tab">招聘信息</a></li>
				<li><a href="#seo" data-toggle="tab">SEO信息</a></li>
			</ul>
			<div id="myTabContent" class="tab-content">
				<div class="tab-pane fade in active" id="info">
					<div class="row">
						<div class="col-md-6 col-sm-6 col-xs-6" >
							<input type="hidden" id="id" name="id" value="${entity.id}" /> 
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">部门<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.department}" name="department" id="department"  placeholder="部门"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">职位<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.position}" name="position" id="position"  placeholder="职位"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">工作类型<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.jobType}" name="jobType" id="jobType"  placeholder="工作类型"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">工作经验</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.experience}" name="experience" id="experience"  placeholder="工作经验"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">学历要求</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.education}" name="education" id="education"  placeholder="学历要求"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">语言能力</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.language}" name="language" id="language"  placeholder="语言能力"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">性别</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<select name="gender" id="gender" class="form-control input-sm">
										<option value="不限" <c:if test="${entity.gender=='不限' }">selected="selected"</c:if>>不限</option>
										<option value="男" <c:if test="${entity.gender=='男' }">selected="selected"</c:if>>男</option>
										<option value="女" <c:if test="${entity.gender=='女' }">selected="selected"</c:if>>女</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">年龄</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.age}" name="age" id="age"  placeholder="年龄"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">状态</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<select name="status" id="status" class="form-control input-sm">
										<option value="true" <c:if test="${entity.status==true }">selected="selected"</c:if>>开启</option>
										<option value="false" <c:if test="${entity.status==false }">selected="selected"</c:if>>关闭</option>
									</select>
								</div>
							</div>
						</div>
						<div class="col-md-6 col-sm-6 col-xs-6" >
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">职位月薪<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.wage}" name="wage" id="wage"  placeholder="职位月薪"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">招聘人数<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.num}" name="num" id="num"  placeholder="招聘人数"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">工作城市<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.city}" name="city" id="city"  placeholder="工作城市"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">联系人</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.contact}" name="contact" id="contact"  placeholder="联系方式"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">联系电话</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.phone}" name="phone" id="phone"  placeholder="联系方式"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">E-mail</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.email}" name="email" id="email"  placeholder="联系方式"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">截止日期<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="<fmt:formatDate value='${entity.closeTime}' pattern='yyyy-MM-dd HH:mm:ss' />" name="closeTime" id="closeTime" onfocus="dateUtils.showNowDate('closeTime');"  placeholder="截止日期"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">发布日期<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="<fmt:formatDate value='${entity.publishTime}' pattern='yyyy-MM-dd HH:mm:ss' />" name="publishTime" id="publishTime" onfocus="dateUtils.showNowDate('publishTime');"   placeholder="发布日期"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">浏览数</label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.pageView}" name="pageView" id="pageView"  placeholder="浏览数"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-2 col-sm-2 col-xs-2 control-label">排序<span style="color: red">*</span></label>
								<div class="col-md-10 col-sm-10 col-xs-10">
									<input type="text" class="form-control input-sm" value="${entity.sort}" name="sort" id="sort"  placeholder="排序"/>
								</div>
							</div>
						</div>
					</div>
					<div class="row">
						<div class="col-md-12 col-sm-12 col-xs-12" >
							<div class="form-group">
								<label class="col-md-1 col-sm-1 col-xs-1 control-label"> 职位描述</label>
								<div class="col-md-11 col-sm-11 col-xs-11">
									<textarea id="content" name="content" style="width: 100%; height: 200px; visibility: hidden;">${entity.content }</textarea> 您当前输入了 <span class="word_count">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-1 col-sm-1 col-xs-1 control-label">岗位要求</label>
								<div class="col-md-11 col-sm-11 col-xs-11">
									<textarea id="requirement" name="requirement" style="width: 100%; height: 200px; visibility: hidden;">${entity.requirement }</textarea> 您当前输入了 <span class="word_count2">0</span> 个文字。（字数统计包含纯文本、IMG、EMBED，不包含换行符，IMG和EMBED算一个文字。）
								</div>
							</div>
						</div>
					</div>
				</div>


				<div class="tab-pane fade" id="seo">
					<div class="row">
						<div class="col-md-12 col-sm-12 col-xs-12" >
							<div class="form-group">
								<label class="col-md-1 col-sm-1 col-xs-1 control-label">Title</label>
								<div class="col-md-11 col-sm-11 col-xs-11">
									<input type="text" class="form-control input-sm" value="${entity.seoTitle}" name="seoTitle" id="seoTitle"  placeholder="seoTitle"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-1 col-sm-1 col-xs-1 control-label">Keyword</label>
								<div class="col-md-11 col-sm-11 col-xs-11">
									<input type="text" class="form-control input-sm" value="${entity.seoKeywords}" name="seoKeywords" id="seoKeywords"  placeholder="seoKeywords"/>
								</div>
							</div>
							<div class="form-group">
								<label class="col-md-1 col-sm-1 col-xs-1 control-label">Description</label>
								<div class="col-md-11 col-sm-11 col-xs-11">
									<input type="text" class="form-control input-sm" value="${entity.seoDescription}" name="seoDescription" id="seoDescription"  placeholder="seoDescription"/>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</form:form>
	</div>
</div>								
<script type="text/javascript">
var result = 0;
var validateForm;
$(document).ready(function() {
	//初始在线编辑器
    ShowEditorHtml("#content", "word_count");
    ShowEditorHtml("#requirement", "word_count2");

	validateForm = $("#inputForm").validate({
		rules : {
			department : {
				required : true
			},
			position : {
				required : true
			},
			jobType : {
				required : true
			},
			sort : {
				required : true
			},
			closeTime : {
				required : true
			},
			publishTime : {
				required : true
			},
			status : {
				required : true
			}
		},
		messages : {
			department : {
				required : "部门不能为空"
			},
			position : {
				required : "职位不能为空"
			},
			jobType : {
				required : "工作类型不能为空"
			},
			sort : {
				required : "排序不能为空"
			},
			closeTime : {
				required : "截止日期不能为空"
			},
			publishTime : {
				required : "发布日期不能为空"
			},
			status : {
				required : "状态不能为空"
			}
		},
		errorElement : "em",
		errorClass : "validate_error",
		submitHandler: function(form) { //通过之后回调
		},
		invalidHandler: function(form, validator) {
			return false;
		}
	});

});
</script>	
</body>
</html>